package com.ark.cloud.javacallnative.modules.storage.service.impl;

import com.alibaba.fastjson.JSON;
import com.ark.cloud.javacallnative.entity.JammerEvent;
import com.ark.cloud.javacallnative.modules.storage.mapper.JammerEventMapper;
import com.ark.cloud.javacallnative.modules.storage.service.JammerEventService;
import com.ark.cloud.javacallnative.util.UUIDUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class JammerEventServiceImpl extends ServiceImpl<JammerEventMapper, JammerEvent> implements JammerEventService {


    @Resource
    private JammerEventMapper jammerEventMapper;

    @Override
    public void saveJammerEvent(JammerEvent jammerEvent) {
        jammerEvent.setId(UUIDUtil.next());
        jammerEvent.setJammeredEntId(jammerEvent.getJammerEntIdList().toString());
        System.out.println("jammerEvent: {}"+JSON.toJSONString(jammerEvent));

        jammerEventMapper.saveJammerEvent(jammerEvent);


    }


}
